﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jayden.Dll.Cards.Poker.Enums;

namespace Jayden.Dll.Cards.Poker
{
	public class PokerTableView
	{
		public string TournamentName;
		public string TableName;
		public string Currency;
		public ulong Ante;
		public ulong SmallBlind;
		public ulong BigBlind;
		public byte Button;
		public PokerType Type;
		public PokerLimit Limit;
		public PokerStreetType Street;
		public Card[] Cards;
		public ulong Pot;
		public PokerStreetType State;
		public byte CurrentAction = 0xff;
		public bool DealerBusy;
		public ulong CallAmount;
		public ulong MinRaiseAmount;
		public byte[] PlayersLeftToTalk;

		public bool IsTournament { get { return !IsCashGame; } }
		public bool IsCashGame { get { return string.IsNullOrWhiteSpace(TournamentName); } }

		public PokerTableSeatView[] Seats;

		public class PokerTableSeatView
		{
			public byte Index;
			public string Name;
			public ulong Stack;
			public PokerSeatState State;
			public ulong Bet;
			public Card[] Cards;

			public bool ViewCards { get { return Cards != null && Cards[0] != null; } }
		}

		public bool IsSitted(string name)
		{
			for (int c = 0; c < Seats.Length; c++)
				if (Seats[c] != null && Seats[c].Name == name)
					return true;
			return false;
		}
	}
}
